package com.fdm.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.engine.internal.Cascade;

@Entity
@Table(name="customers")
public class Customer {
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE)
	@Column(name="cust_id")
	private long id;
	private String firstname;
	private String lastname;
	@Column(unique=true)
	private String email;
	@Temporal(TemporalType.DATE)
	private Date dob;
	private String password;
	private String enabled;
	//@JoinColumn(name="customer_roles_id")
	@OneToOne(cascade=CascadeType.ALL)
	private CustomerRoles customerRoles;
	public String getEmail(){
		return email;
	}
	public void setEmail(String email){
		this.email=email;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getFirstname() {
		return firstname;
	}
	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}
	public String getLastname() {
		return lastname;
	}
	public void setLastname(String lastname) {
		this.lastname = lastname;
	}
	public Date getDob() {
		return dob;
	}
	public void setDob(Date dob) {
		this.dob = dob;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getEnabled() {
		return enabled;
	}
	public void setEnabled(String enabled) {
		this.enabled = enabled;
	}
	public CustomerRoles getCustomerRoles() {
		return customerRoles;
	}
	public void setCustomerRoles(CustomerRoles customerRoles) {
		this.customerRoles = customerRoles;
	}
	
}
